package com.spi.soconversion.base.definition;

import java.math.BigDecimal;

import com.spi.soconversion.util.SOCConstants;
import com.spi.soconversion.util.SOCUtility;
import com.spi.soconversion.util.XMLAttributeConstants;
import com.spi.soconversion.util.XMLTagConstants;

public class SOCOrderLinePriceInfo {
	private String actualPricingQty;
	private String isLinePriceForInformationOnly = SOCConstants.FLAG_N;
	private String lineTotal;
	private String listPrice;
	private int orderedPricingQty;
	private BigDecimal retailPrice;
	private BigDecimal unitPrice;

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();

		sb.append(XMLTagConstants.START_TAG_LINE_PRICE_INFO);
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.ACT_PRICING_QTY,getActualPricingQty()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.PRICE_FOR_INFORMATION_ONLY,getIsLinePriceForInformationOnly()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.LINE_TOTAL,getLineTotal()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.LIST_PRICE,getListPrice()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.ORDERED_PRICING_QTY,String.valueOf(getOrderedPricingQty())));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.RETAIL_PRICE, getRetailPrice().toString()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.UNIT_PRICE,getUnitPrice().toString()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCConstants.CLOSING_XML_TAG);
		sb.append(SOCConstants.NEW_LINE);

		sb.append(XMLTagConstants.END_TAG_LINE_PRICE_INFO);

		return sb.toString();

	}

	public String getActualPricingQty() {
		return SOCUtility.checkNull(actualPricingQty);
	}

	public void setActualPricingQty(String actualPricingQty) {
		this.actualPricingQty = actualPricingQty;
	}

	public String getIsLinePriceForInformationOnly() {
		return isLinePriceForInformationOnly;
	}

	
	public void setLineTotal(String lineTotal) {
		this.lineTotal = lineTotal;
	}

	public String getLineTotal() {
		return SOCUtility.checkNull(lineTotal);
	}

	public String getListPrice() {
		return SOCUtility.checkNull(listPrice);
	}

	public void setListPrice(String listPrice) {
		this.listPrice = listPrice;
	}

	public int getOrderedPricingQty() {
		return orderedPricingQty;
	}

	public void setOrderedPricingQty(int orderedPricingQty) {
		this.orderedPricingQty = orderedPricingQty;
	}

	public BigDecimal getRetailPrice() {
		return SOCUtility.checkNumberNull(retailPrice);
	}

	public void setRetailPrice(BigDecimal retailPrice) {
		this.retailPrice = retailPrice;
	}

	public BigDecimal getUnitPrice() {
		return SOCUtility.checkNumberNull(unitPrice);
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}

}
